<%@ Page Title="CR_RepaymentPlan Item" Language="C#" AutoEventWireup="true" CodeBehind="CR_RepaymentPlanItemz.aspx.cs" Inherits="Youz.CreditRepay.Manage.CR_RepaymentPlanItemz" %>
<script>
    //loadCSS("UIResources/Scripts/jquery.validate/valid.css");

    var requireJS = [
        //"assets/js/jquery.form.js"
    ];
    loadJS(requireJS);
</script><div class="row"><div class="col-lg-12"><div class="panel panel-default"><div class="panel-heading"><h2><i class="fa fa-edit"></i><%: R(LanguageModule.CR_RepaymentPlan, "CR_RepaymentPlan", "CR_RepaymentPlan") %></h2></div><div class="panel-body"><form id="frm" class="form-horizontal" method="post" enctype="multipart/form-data" action="Right/Handlers/CR_RepaymentPlanHandler.ashx?type=save"><input id="ID" name="ID" type="hidden" />
<div class="form-group">
<label class="control-label" for="MemberAccount"><%: R(LanguageModule.CR_RepaymentPlan, "MemberAccount", "MemberAccount") %></label>
<div class="controls"><input type="text" id="MemberAccount" name="MemberAccount" maxlength="100" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="BankCardID"><%: R(LanguageModule.CR_RepaymentPlan, "BankCardID", "BankCardID") %></label>
<div class="controls"><input type="text" id="BankCardID" name="BankCardID" maxlength="4" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="BillingAmount"><%: R(LanguageModule.CR_RepaymentPlan, "BillingAmount", "BillingAmount") %></label>
<div class="controls"><input type="text" id="BillingAmount" name="BillingAmount" maxlength="9" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="RepaymentAmount"><%: R(LanguageModule.CR_RepaymentPlan, "RepaymentAmount", "RepaymentAmount") %></label>
<div class="controls"><input type="text" id="RepaymentAmount" name="RepaymentAmount" maxlength="9" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="Fee"><%: R(LanguageModule.CR_RepaymentPlan, "Fee", "Fee") %></label>
<div class="controls"><input type="text" id="Fee" name="Fee" maxlength="9" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="RepayedAmount"><%: R(LanguageModule.CR_RepaymentPlan, "RepayedAmount", "RepayedAmount") %></label>
<div class="controls"><input type="text" id="RepayedAmount" name="RepayedAmount" maxlength="9" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="BeginDate"><%: R(LanguageModule.CR_RepaymentPlan, "BeginDate", "BeginDate") %></label>
<div class="controls"><input type="text" id="BeginDate" name="BeginDate" maxlength="8" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="EndDate"><%: R(LanguageModule.CR_RepaymentPlan, "EndDate", "EndDate") %></label>
<div class="controls"><input type="text" id="EndDate" name="EndDate" maxlength="8" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="Quantity"><%: R(LanguageModule.CR_RepaymentPlan, "Quantity", "Quantity") %></label>
<div class="controls"><input type="text" id="Quantity" name="Quantity" maxlength="4" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="Status"><%: R(LanguageModule.CR_RepaymentPlan, "Status", "Status") %></label>
<div class="controls"><input type="text" id="Status" name="Status" maxlength="4" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="CreatedOn"><%: R(LanguageModule.CR_RepaymentPlan, "CreatedOn", "CreatedOn") %></label>
<div class="controls"><input type="text" id="CreatedOn" name="CreatedOn" maxlength="8" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="ModifiedOn"><%: R(LanguageModule.CR_RepaymentPlan, "ModifiedOn", "ModifiedOn") %></label>
<div class="controls"><input type="text" id="ModifiedOn" name="ModifiedOn" maxlength="8" class="form-control" /></div>
</div>
<div class="alert alert-danger" style="display: none;"><button type="button" class="close" data-dismiss="alert">×</button><strong>Oh snap!</strong><span class="content"></span></div><div class="form-actions"><button class="btn btn-success" type="submit" id="btnSubmit"><%: R(LanguageModule.M_Common, "btnSubmit", "保存修改") %></button>
						<button class="btn btn-default" type="button" id="btnCancel"><%: R(LanguageModule.M_Common, "btnCancel", "取消") %></button></div></form></div></div></div></div><script type="text/javascript">

    var flag = false;

    function validate() {
        return $("#frm").valid();
    };

    function get() {
        $.post("CR/Handlers/CR_RepaymentPlanHandler.ashx?type=get", { ID: "<%= WebHelper.Get("ID") %>" }, function (data) {
                $('#frm').fill(data);
            }, 'json');
        }

        $(function () {
            $("#frm").validate({
                errorElement: "span"
            });

            get();

            $("#frm").ajaxForm({
                dataType: 'json',
                beforeSubmit: function (arr, $form, options) {
                    if (flag) {
                        return false;
                    }
                    else {
                        flag = true;
                        return true;
                    }
                },
                success: function (data) {
                    if (data.isSuccess) {
                        loadPage("CR/CR_RepaymentPlanList.aspx");
                    }
                    else {
                        $(".alert > .content").html(data.message);
                        $(".alert").show();
                    }
                    flag = false;
                }
            });

            $("#btnCancel").click(function () {
                loadPage("CR/CR_RepaymentPlanList.aspx");				
            });
        });

</script>